package com.whut.service.impl;

import com.whut.mapper.NewproblemdescriptionMapper;
import com.whut.mapper.ProblemdescriptionMapper;
import com.whut.model.Newproblemdescription;
import com.whut.model.Problemcollect;
import com.whut.model.Problemdescription;
import com.whut.service.ProblemDescriptionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;

@Service("ProblemDescriptionService")
public class ProblemDescriptionServiceImpl implements ProblemDescriptionService {
    @Resource
    private NewproblemdescriptionMapper newproblemdescriptionMapper;
    @Override
    public String saveCheckResultEdit(int number, String problemDescription, String normsProvison, String problemNum) {
        try {
            Newproblemdescription problemdescription=new Newproblemdescription();
            SimpleDateFormat formatter= new SimpleDateFormat("yyyy-MM-dd 'at' HH:mm:ss z");
            Date date = new Date(System.currentTimeMillis());
            problemdescription.setNumber(number);
            System.out.println("number"+number);
            problemdescription.setProblemDescription(problemDescription);
            problemdescription.setNormsProvison(normsProvison);
            problemdescription.setProblemNum(problemNum);
            newproblemdescriptionMapper.updateByPrimaryKeySelective(problemdescription);
            return "success";
        } catch (Exception e) {
            e.printStackTrace();
            return "error";
        }
    }
}
